package com.qingfeng.exception;

import com.alibaba.druid.util.StringUtils;
import com.qingfeng.util.CodeEnum;
import lombok.Data;

@Data
public class LsException extends RuntimeException{
    /**
     * 状态码
     */
    private Integer code;

    /**
     * 提示
     */
    private  String message;

    public LsException(int i, String msg) {
        this.code = i;
        this.message=msg;
    }

    public LsException(CodeEnum codeEnum, String msg) {
        this.code = codeEnum.getCode();
        if (StringUtils.isEmpty(msg)){
            this.message = codeEnum.getMsg();
        }else {
            this.message = msg;
        }
    }
}
